package com.ruoyi.shop.clientuser.history.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.common.mapper.DtsSearchHistoryMapper;
import com.ruoyi.mall.common.domain.DtsSearchHistory;
import com.ruoyi.shop.clientuser.history.service.IDtsSearchHistoryService;

/**
 * 搜索历史Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-17
 */
@Service
public class DtsSearchHistoryServiceImpl implements IDtsSearchHistoryService 
{
    @Autowired
    private DtsSearchHistoryMapper dtsSearchHistoryMapper;

    /**
     * 查询搜索历史
     * 
     * @param id 搜索历史主键
     * @return 搜索历史
     */
    @Override
    public DtsSearchHistory selectDtsSearchHistoryById(Long id)
    {
        return dtsSearchHistoryMapper.selectDtsSearchHistoryById(id);
    }

    /**
     * 查询搜索历史列表
     * 
     * @param dtsSearchHistory 搜索历史
     * @return 搜索历史
     */
    @Override
    public List<DtsSearchHistory> selectDtsSearchHistoryList(DtsSearchHistory dtsSearchHistory)
    {
        return dtsSearchHistoryMapper.selectDtsSearchHistoryList(dtsSearchHistory);
    }

    /**
     * 新增搜索历史
     * 
     * @param dtsSearchHistory 搜索历史
     * @return 结果
     */
    @Override
    public int insertDtsSearchHistory(DtsSearchHistory dtsSearchHistory)
    {
        return dtsSearchHistoryMapper.insertDtsSearchHistory(dtsSearchHistory);
    }

    /**
     * 修改搜索历史
     * 
     * @param dtsSearchHistory 搜索历史
     * @return 结果
     */
    @Override
    public int updateDtsSearchHistory(DtsSearchHistory dtsSearchHistory)
    {
        dtsSearchHistory.setUpdateTime(DateUtils.getNowDate());
        return dtsSearchHistoryMapper.updateDtsSearchHistory(dtsSearchHistory);
    }

    /**
     * 批量删除搜索历史
     * 
     * @param ids 需要删除的搜索历史主键
     * @return 结果
     */
    @Override
    public int deleteDtsSearchHistoryByIds(Long[] ids)
    {
        return dtsSearchHistoryMapper.deleteDtsSearchHistoryByIds(ids);
    }

    /**
     * 删除搜索历史信息
     * 
     * @param id 搜索历史主键
     * @return 结果
     */
    @Override
    public int deleteDtsSearchHistoryById(Long id)
    {
        return dtsSearchHistoryMapper.deleteDtsSearchHistoryById(id);
    }
}
